Skip to content

feat: import Telegram Desktop chat exports#82

Open
GeiserX wants to merge 1 commit intomasterfrom
ai/import-desktop-export
Open

feat: import Telegram Desktop chat exports#82
GeiserX wants to merge 1 commit intomasterfrom
ai/import-desktop-export

Conversation

@GeiserX
Copy link
Owner

@GeiserX GeiserX commented Feb 25, 2026

Summary

  • New telegram-archive import CLI command that reads Telegram Desktop exports (result.json + media folders) and inserts them into the database
  • Imported chats appear in the web viewer identically to live-backed-up chats
  • Supports both single-chat and full-account export formats

Flags: --path, --chat-id, --dry-run, --skip-media, --merge

Supported content: Text, photos, videos, documents, voice messages, stickers, animations, service messages, forwards, replies, edited messages.

Closes #81

Test plan

  • --dry-run on a real Telegram Desktop export — verify parse + validation without DB writes
  • Import a single personal chat — verify messages and media appear in viewer
  • Import a supergroup/channel — verify chat ID derivation (marked format)
  • Import with --skip-media — verify messages imported, no media copied
  • Import with --merge into existing chat — verify upsert works
  • Import without --merge into existing chat — verify refusal
  • Full-account export with multiple chats — verify all chats imported
  • Run existing test suite — all 128 tests pass

@github-actions
Copy link

🐳 Dev images published!

  • drumsergio/telegram-archive:dev
  • drumsergio/telegram-archive-viewer:dev

The dev/test instance will pick up these changes automatically (Portainer GitOps).

To test locally:

docker pull drumsergio/telegram-archive:dev
docker pull drumsergio/telegram-archive-viewer:dev

@GeiserX GeiserX force-pushed the ai/import-desktop-export branch from ff23f25 to 3d4e19d Compare February 25, 2026 09:51
New `telegram-archive import` CLI command that reads Telegram Desktop
exports (result.json + media folders) and inserts messages, users, and
media into the database. Imported chats appear in the web viewer like
any other backed-up chat.

Supports --dry-run, --skip-media, --merge, --chat-id flags.
Handles text, photos, videos, documents, voice, stickers, service
messages, forwards, replies, and edited messages.

Closes #81
@GeiserX GeiserX force-pushed the ai/import-desktop-export branch from 3d4e19d to 2a1c824 Compare February 25, 2026 09:52
@github-actions
Copy link

🐳 Dev images published!

  • drumsergio/telegram-archive:dev
  • drumsergio/telegram-archive-viewer:dev

The dev/test instance will pick up these changes automatically (Portainer GitOps).

To test locally:

docker pull drumsergio/telegram-archive:dev
docker pull drumsergio/telegram-archive-viewer:dev

1 similar comment
@github-actions
Copy link

🐳 Dev images published!

  • drumsergio/telegram-archive:dev
  • drumsergio/telegram-archive-viewer:dev

The dev/test instance will pick up these changes automatically (Portainer GitOps).

To test locally:

docker pull drumsergio/telegram-archive:dev
docker pull drumsergio/telegram-archive-viewer:dev

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature]: Import support for Telegram Desktop chat exports (+media folders)

1 participant